// import LoginShade from "@/components/base/shade/LoginShade";
// import RegisterShade from "@/components/base/shade/RegisterShade";
// import ChangeWordShade from "@/components/base/shade/ChangeWordShade";
// import dsfimg from "/components/base/dsfimg.vue";
// export default {
// 插件的初始化，插件给你提供的全局的功能，都可以在这里配置
// install(Vue) {
// 定义全局组件
// Vue.component("LoginShade", LoginShade);
// Vue.component("RegisterShade", RegisterShade);
// Vue.component("ChangeWordShade", ChangeWordShade);
//     Vue.component("dsfimg", dsfimg);
//   },
// };
// 定义全局组件

/*
 **全局注册组件
 ** 放在components/base文件夹下
 */
import { defineAsyncComponent } from "vue";
const components = import.meta.glob("./base/**/*.vue"); // 异步方式
export default function install(app) {
  for (const [key, value] of Object.entries(components)) {
    const name = key.slice(key.lastIndexOf("/") + 1, key.lastIndexOf("."));
    app.component(name, defineAsyncComponent(value));
  }
}
